home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / MBLIB10.ZIP;1 / CPPEXAMP.ZIP / MSGHDR.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  1.1 KB  |  62 lines

  1. #include <string.h>
  2.  
  3. #include "msghdr.hpp"
  4.  
  5. /*=========================================================================*/
  6.  
  7. void MsgHdr::From (char *name)
  8.  
  9. {
  10.     strcpy (hdr.who_from, name);
  11.     hdr.orig_zone = 0;
  12.     hdr.orig_net = 0;
  13.     hdr.orig_node = 0;
  14. };
  15.  
  16. void MsgHdr::From (char *name, int zone, int net, int node)
  17.  
  18. {
  19.     strcpy (hdr.who_from, name);
  20.     hdr.orig_zone = zone;
  21.     hdr.orig_net = net;
  22.     hdr.orig_node = node;
  23. }
  24.  
  25. void MsgHdr::To (char *name)
  26.  
  27. {
  28.     strcpy (hdr.who_to, name);
  29.     hdr.dest_zone = 0;
  30.     hdr.dest_net = 0;
  31.     hdr.dest_node = 0;
  32. }
  33.  
  34. void MsgHdr::To (char *name, int zone, int net, int node)
  35.  
  36. {
  37.     strcpy (hdr.who_to, name);
  38.     hdr.dest_zone = zone;
  39.     hdr.dest_net = net;
  40.     hdr.dest_node = node;
  41. }
  42.  
  43. void MsgHdr::Subject (char *subject)
  44.  
  45. {
  46.     strcpy (hdr.subject, subject);
  47. }
  48.  
  49. void MsgHdr::SetAttribute (unsigned attributes)
  50.  
  51. {
  52.     hdr.net_attr |= (attributes >> 8);
  53.     hdr.msg_attr |= (attributes & 0xff);
  54. }
  55.  
  56. void MsgHdr::UnsetAttribute (unsigned attributes)
  57.  
  58. {
  59.     hdr.net_attr &= ~(attributes >> 8);
  60.     hdr.msg_attr &= ~(attributes & 0xff);
  61. }
  62.